<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE6">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<link rel="shortcut icon" href="<%=basePath%>favicon.ico" />
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/all_b.css?20161126">
<script type="text/javascript">var basePath = "<%=basePath%>";</script>
<script type="text/javascript"
	src="<%=basePath%>js/jquery.min.js?20161126"></script>
<script type="text/javascript"
	src="<%=basePath%>js/layer/layer.js?20161126"></script>
<title>代理盘 - 最近30期开奖结果</title>
</head>
<body id="bodyModule">
	<jsp:include page="../commons/manage_head.jsp" flush="true"></jsp:include>
	<div id="layout" class="container" style="height: 666px;">
		<div class="main-content1" style="display: block;">
			<div id="result_pk10" class="result pk10">
				<h3 class="lh2" style="color: #063863; margin-bottom: 4px;">
					<b class="reder"></b>开奖结果最新30期
				</h3>
				<select id="topSelect_pk10" class="topSelect">
					<option value="pk10" selected="selected">北京赛车(PK10)</option>
				</select>
				<table class="bet-table z3-table">
					<thead>
						<tr class="">
							<th>期数</th>
							<th>开奖时间</th>
							<th colspan="10">开奖号码</th>
							<th colspan="3">冠亚和</th>
							<th>冠军</th>
							<th>亚军</th>
							<th>第三名</th>
							<th>第四名</th>
							<th>第五名</th>
						</tr>
					</thead>
					<tbody id="windata"></tbody>
				</table>
			</div>
		</div>
	</div>
	<div class="footer">
		<div class="marquee">
			<p class="marqueeBox">
				<marquee id="marqueeBox" scrollamount="2">欢迎光临...........</marquee>
			</p>
		</div>
	</div>
</body>
<script type="text/javascript">
	$(function(){
		 $(document).bind("contextmenu",function(e){   
	       return false;   
	 	 });
		 var index,html;
		 $.ajax({
			    url:basePath+"manage/win_list",dataType:"json",async:true,data:{"t":Math.random()},type:"GET",
			    beforeSend:function(){
			    	index = layer.load(1, {
			    	  shade: [0.1,'#fff']
			    	});
			    },success:function(req){
			        if(req.resultCode == '5'){
						layer.msg("登录已失效，请重新登录");
						return;
					}
			        if(req.resultCode == '6'){
						layer.msg("该请求没有权限");
						return;
					}
			    	$.each(req.dataList, function(i, item) {
			    		var num1 = Number(item.num1);
			    		var num2 = Number(item.num2);
			    		var num3 = Number(item.num3);
			    		var num4 = Number(item.num4);
			    		var num5 = Number(item.num5);
			    		var num6 = Number(item.num6);
			    		var num7 = Number(item.num7);
			    		var num8 = Number(item.num8);
			    		var num9 = Number(item.num9);
			    		var num10 = Number(item.num10);
			    		var num12,num13,num14,num15,num16,num17,num18;
			    		if((num1+num2)>11){
			    			num12 = "大";
			    		}else{
			    			num12 = "小";
			    		}
			    		if((num1+num2)%2==0){
			    			num13 = "双";
			    		}else{
			    			num13 = "单";
			    		}
			    		if(num1 > num10){
			    			num14 = "龍";
			    		}else{
			    			num14 = "虎";
			    		}
			    		if(num2 > num9){
			    			num15 = "龍";
			    		}else{
			    			num15 = "虎";
			    		}
			    		if(num3 > num8){
			    			num16 = "龍";
			    		}else{
			    			num16 = "虎";
			    		}
			    		if(num4 > num7){
			    			num17 = "龍";
			    		}else{
			    			num17 = "虎";
			    		}
			    		if(num5 > num6){
			    			num18 = "龍";
			    		}else{
			    			num18 = "虎";
			    		}
			    		html += "<tr><td>"+item.termCd+"</td><td>"+getFormatDateByLong(item.winTime,'MM-dd hh:mm')+"</td><td colspan='10'><span class='number num"+num1+"'></span><span class='number num"+num2+"'></span>";
			    		html += "<span class='number num"+num3+"'></span> <span class='number num"+num4+"'></span> <span class='number num"+num5+"'></span> <span class='number num"+num6+"'></span>";
			    		html += "<span class='number num"+num7+"'></span> <span class='number num"+num8+"'></span> <span class='number num"+num9+"'></span> <span class='number num"+num10+"'></span></td>";
			    		html += "<td class='bold'>"+(num1+num2)+"</td><td class='bold'><span class='reder'>"+num12+"</span></td><td class='bold'><span class='reder'>"+num13+"</span></td><td class='bold'>"+num14+"</td>";
			    		html += "<td class='bold'><span class='blue'>"+num15+"</span></td><td class='bold'>"+num16+"</td><td class='bold'>"+num17+"</td><td class='bold'>"+num18+"</td></tr>";
			        });
			    	$("#windata").append(html);
			    },complete:function(){
			    	layer.close(index);
			    },error:function(){
			    	layer.msg("网络异常请重试");
			    }
		});
	});  
    Date.prototype.format = function (format) {  
        var o = {  
            "M+": this.getMonth() + 1,  
            "d+": this.getDate(),  
            "h+": this.getHours(),  
            "m+": this.getMinutes(),  
            "s+": this.getSeconds(),  
            "q+": Math.floor((this.getMonth() + 3) / 3),  
            "S": this.getMilliseconds()  
        }  
        if (/(y+)/.test(format)) {  
            format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));  
        }  
        for (var k in o) {  
            if (new RegExp("(" + k + ")").test(format)) {  
                format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));  
            }  
        }  
        return format;  
    }  
	function getFormatDateByLong(l, pattern) {  
        return getFormatDate(new Date(l), pattern);  
    }
	function getFormatDate(date, pattern) {  
        if (date == undefined) {  
            date = new Date();  
        }  
        if (pattern == undefined) {  
            pattern = "yyyy-MM-dd hh:mm:ss";  
        }  
        return date.format(pattern);  
    }  
</script>
</html>